<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>驳回</title>
    <jsp:include page="../../head.jsp"/>
</head>
<script type="text/javascript">
    var id = "${id}";
    var type = "${type}";
    var formSetting = {
        title: "驳回",
        module: "save",
        numCount: "1",
        columns: [{
            name: "rejectContent.id",
            label: "id",
            hidden: true
        }, {
            name: "rejectContent.content",
            label: "驳回内容",
            type: "textarea"
        }],
        form: {
            'url': 'rejectContent-saveOrUpdate?id=' + id + "&type=" + type,
            'data': function () {
                if (id) {
                    var dataValue = "";
// 					$.ajax({
// 						url : "rejectContent-find?rejectContent.id=" + id,
// 						async : false,
// 						cache : false,
// 						success : function(data) {
// 							dataValue = data;
// 						}
// 					});
                    return dataValue;
                } else {
                    return null;
                }
            },
            'ajaxForm': {
                success: function () {
                    if (type == 1) {
                        window.parent.location.href =
                                "declaration-listForSupToValidate?declaraState=DS01&date="
                                + new Date();
                    } else if (type == 2) {
                        window.parent.location.href =
                                "trail-listForSupToValidate?date=" + new Date();
                    } else if (type == 3) {
                        window.parent.location.href =
                                "booking-listForSupToValidate?date=" + new Date();
                    }
                }
            }
// 			'afterAjaxSuccess' : function(responseText, statusText, xhr, $form) {
// 				var state = $.parseJSON(responseText.msg).state;
// 				if(state=="1") {
// 					try{jw.close();}catch(err){}
// 				}
// 			}
        },
        buttons: {
            custom: [
                {
                    id: "cancleBtn",
                    value: "取消",
                    click: function () {
                        jw.close();
                    }
                }
            ]
        }
    };
    $(document).ready(function () {
        $("#rejectForm").mrdForm(formSetting);
    });
</script>
<body>
<div style="width: 100%">
    <div id="rejectForm"></div>
</div>
</body>
</html>
